#include <bits/stdc++.h>
#define LL long long
using namespace std;
int n, r[100005], ans;
int main()
{
    freopen("duel.in", "r", stdin);
    freopen("duel.out", "w", stdout);
    cin >> n;
    for (int i = 0; i < n; i++) {
        int temp;
        cin >> temp;
        r[temp]++;
        ans++;
    }
    for (int i = 1; i < 100000; i++) {
        if (r[i] == 0) {
            continue;
        }
        // if (r[i]) cout << 'i' << r[i] << ' ';
        int j;
        for (j = 1; r[i + j] == 0 && j + i <= 100000; j++) {}
        // if (j) cout << 'j' << j << ' ';
        ans -= min(r[i], r[i + j]);
        r[i] -= min(r[i], r[i + j]);
    }
    cout << ans;
//    for (int i = 0; i < n; i++) {
//        cout << v[i] << ' ';
//    }
    return 0;
}
